﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Inter.MianShi.Model;
using System.Data.SqlClient;

namespace Inter.MianShi.DAL
{
    public class UsersDal
    {
        string str = "Data Source=.;Initial Catalog=MianShiHuiZong;Integrated Security=True";
        public int Logindeng(string name,string pwd)
        {
            SqlConnection con = new SqlConnection(str);
            con.Open();
            string sql = "select count(*) from Users where Uname='" + name + "' and Upwd='"+pwd+"'";
            SqlCommand com = new SqlCommand(sql,con);
            int i = Convert.ToInt32( com.ExecuteScalar());
            con.Close();
            return i;
        }
    }
}
